package com.geekgo.flowcontroller.utils;

import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;

/**
 * @author geekgo
 * @version 2016/8/4 15:41
 */
public class CglibProxy {

    public static Object createProxy(Class<?> clazz, MethodInterceptor interceptor){
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clazz);
        enhancer.setCallback(interceptor);
        return enhancer.create();
    }
}
